#include "cpu/exec/template-start.h"

#define instr call

static void do_execute() {
	int len;
	cpu.esp -= 4;
	if (op_src -> type == OP_TYPE_IMM) {
		len = DATA_BYTE;
	} else {
		if (op_src -> type == OP_TYPE_MEM) {
			len = 2;
		} else {
			len = 1;
		}
	}
	swaddr_write(cpu.esp, 4, cpu.eip + 1 + len, R_SS);

	if (op_src -> type == OP_TYPE_IMM) {
		cpu.eip += op_src -> val;
	} else {
		cpu.eip = op_src -> val - 1 - len;
	}
	print_asm(str(instr) " %x", cpu.eip + 1 + len);
}

make_instr_helper(si)
make_instr_helper(rm)

#include "cpu/exec/template-end.h"
